#/bin/bash

echo "rtc_rtc2pi" | nc -q 0 127.0.0.1 8423
cd /home/pi/pipaper
ping gitlab.windnbike.site -c 1 && git fetch && git pull
echo "loop $(date -Iminutes)  $(echo "get battery" | nc -q 0 127.0.0.1 8423)" >> log/run.log
ping gitlab.windnbike.site -c 1 && git commit -a -m "$(date +%Y-%m-%d) $(date +%H:%M:%S)" && git push
python3 src/printpic.py
echo "rtc_alarm_set $(date -Iseconds -d "29 minutes") 127" | nc -q 0 127.0.0.1 8423
shutdown now
